package com.emep.emeptime.controller;

import com.emep.emeptime.service.TotalEmissionsService;
import com.emep.emeptime.service.aqi.AqiNumberOfMonthsService;
import com.emep.emeptime.utils.DateUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.ParseException;

/**
 * @author: LFY
 * @version:V1.0
 * @Description:全年污染物的排放总量计算
 * @Date: 2018/8/20 9:39
 */

@Component
@Slf4j
public class TotalEmissionsController {

    @Autowired
    private TotalEmissionsService totalEmissionsService;

    /**
     *全年污染物的排放总量计算 每天晚上23点56执行
     */
    @Scheduled(cron = "0 56 23 * * ?")
   // @Scheduled(cron = "0/2 00 00 * * ?")
    public void time() throws ParseException {
        log.error("*******************  全年污染物的排放总量计算  开始时间：{}", DateUtils.getNowTime());
        totalEmissionsService.save();
    }
}
